package com.hctrl.mybatis.mapper;

import com.hctrl.mybatis.entity.UserDO;
import com.hctrl.mybatis.entity.resp.BlogResp;
import com.hctrl.mybatis.entity.resp.CommentResp;
import org.apache.ibatis.annotations.*;

import javax.naming.Name;
import java.util.List;

@Mapper
//@CacheNamespaceRef(UserMapper.class)
public interface UserMapper {

    UserDO selectById(Long id);

    UserDO selectByCondition(Long id,String sex);

    UserDO selectByCondition1(@Param("id111") Long id,String sex);

    @Select("select * from user where id = #{user111.id} and sex = #{user111.sex} and age = #{age}")
    UserDO selectByCondition2(UserDO user,@Param("age") Integer age);

    CommentResp selectCommentsById(Long id);

    BlogResp selectBlogInfo(Long id);

    List<UserDO> selectBySex(String sex);

    List<UserDO> selectByCondition(String name, Integer age);

    UserDO selectByMap(UserDO user);

    @Update("update user set name = #{name} where id = #{id}")
    void updateNameById(@Param("name") String name,@Param("id") Long id);
}
